package demo.utils;

import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.Date;

public class ConsoleUtil {
    public static void main(String[] args) {
        invokeClass(Method.class);
    }

    public static void invokeClass(Class c){
        Method[] methods = c.getDeclaredMethods();
        int count = 0;
        for (Method method : methods) {
            System.out.println("-------------------------"+ count++ +"--------------------------");
            System.out.println("name --- "+method.getName());
            Parameter[] parameters = method.getParameters();
            System.out.println("params("+method.getParameterCount()+"):");
            for (Parameter parameter : parameters) {
                System.out.println("\t"+parameter.getType()+" --- "+parameter.getName());
            }
            System.out.println("return --- "+method.getReturnType());
            System.out.println("_____________text______________");
//            System.out.println(method.equals(method));
//            System.out.println(method.toString());
            System.out.println("1:"+method.getModifiers());
            System.out.println("2:"+method.getDeclaredAnnotations());
            System.out.println("3:"+method.getDeclaringClass().getName());
            System.out.println("4:"+method.getParameterTypes());
            System.out.println("5:"+method.getReturnType());
            System.out.println("6:"+method.getTypeParameters());
            System.out.println("7:"+method.isDefault());
            System.out.println("8:"+method.isSynthetic());
            System.out.println("9:"+method.toGenericString());
            System.out.println("10:"+method.getParameterAnnotations());
            System.out.println("11:"+method.getParameterCount());
            System.out.println("12:"+method.isVarArgs());
            System.out.println("13:"+method.getAnnotatedReturnType());
            System.out.println("14:"+method.getDefaultValue());
            System.out.println("15:"+method.getExceptionTypes());
            System.out.println("16:"+method.getGenericExceptionTypes());
            System.out.println("17:"+method.getGenericParameterTypes());
            System.out.println("18:"+method.getGenericReturnType());
            System.out.println("19:"+method.isBridge());
            System.out.println("_____________text______________");
        }
    }
}
